package com.example.shop.eventbus;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import org.greenrobot.eventbus.EventBus;

public class MainActivity extends AppCompatActivity {
    private BlankFragment mBlankFragment;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mBlankFragment=new BlankFragment();
        FragmentManager fragmentManager=this.getSupportFragmentManager();
        FragmentTransaction transaction=fragmentManager.beginTransaction();
        transaction.add(R.id.activity_framel,mBlankFragment,"frag");
        transaction.commit();
    }

    public void go1(View v) {
        Toast.makeText(this, "枪呆", Toast.LENGTH_SHORT).show();
        Fate fate=new Fate();
        fate.阿尔托莉雅Alter="乳下";
        fate.阿尔托莉雅="乳上";
        EventBus.getDefault().post(fate);
    }

    public void go2(View v) {
        Toast.makeText(this, "枪托利亚加加跳转2", Toast.LENGTH_SHORT).show();
        Intent intent=new Intent(this,Main2Activity.class);
        startActivity(intent);
    }

    public void go3(View v) {


    }

    public void go4(View v) {


    }
}
